﻿using System;
using System.Linq;
using System.Collections.Generic;

namespace Patterns {
    class Program {
        
        static void Main(string[] args) {
            // To run an example, type the name
            //   of the pattern and then either
            //   AbstractExample.Run() or AppliedExample.Run()

            DependencyInjection.AppliedExample.Run();
    
            Console.ReadKey(true);
        }
    }

    static class Extensions {

        public static void ForEach<TSource>(this IEnumerable<TSource> source, Action<TSource> action) {
            if (source == null)
                throw new ArgumentNullException("source");
            if (action == null)
                return;

            foreach (TSource x in source)
                action(x);
        }
    }
}
